/*
 *    Copyright (c) 2018-2025, cloud All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: cloud
 */

package com.fuyao.cloud.space.tree.controller;

import com.fuyao.cloud.common.core.util.R;
import com.fuyao.cloud.space.tree.service.SpaceTreeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@RequiredArgsConstructor
@RequestMapping("/spaceTree" )
@Api(value = "spaceTree", tags = "空间树控制层")
public class SpaceTreeController {

	private final SpaceTreeService spaceTreeService;

	@ApiOperation(value = "加载区域+楼栋树", notes = "加载区域+楼栋树")
	@PostMapping(value = "/edificeTree")
	public R edificeTree() {
		return R.ok(spaceTreeService.edificeTree());
	}

	@ApiOperation(value = "加载区域+楼栋+楼层树", notes = "加载区域+楼栋+楼层树")
	@PostMapping(value = "/storeyTree")
	public R storeyTree() {
		return R.ok(spaceTreeService.storeyTree());
	}

	@ApiOperation(value = "加载区域+楼栋+楼层+房屋树", notes = "加载区域+楼栋+楼层+房屋树")
	@PostMapping(value = "/houseTree")
	public R houseTree() {
		return R.ok(spaceTreeService.houseTree());
	}
}
